//
//  BaseModel.h
//  E-Cycle(XYXMain)
//
//  Created by 象萌cc003a on 17/2/20.
//  Copyright © 2017年 xmcc003a. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface BaseModel : NSObject

-(instancetype)initWithSourceDict:(NSDictionary *)dict;

@property(nonatomic,strong)NSDictionary *data;

-(instancetype)initWithDictArr:(NSDictionary *)dict;

-(instancetype)initWithSourceDict:(NSDictionary *)dict listItemClass:(Class)cls;

#pragma mark - 该函数的作用在于让相应子类继承，方便实现子类对数据的解析
-(void)getContent:(NSDictionary *)dict withClass:(Class)cls;

@property(nonatomic,copy,readonly)NSString *msg;

@property(nonatomic,assign)NSInteger code;

@property(nonatomic,assign,readonly)BOOL success;

@property(nonatomic,copy)NSArray *list;

-(NSString *)contentForKey:(NSString *)key withSource:(NSDictionary *)source;

-(NSString *)intContentForKey:(NSString *)key withSource:(NSDictionary *)source;

-(CGFloat)floatContentForKey:(NSString *)key withSource:(NSDictionary *)source;

@end
